<!DOCTYPE html>
<html>
<head>
<script>
function runTest()
{
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.dumpChildFrames();
    }
    body = document.getElementById('body');
    frame1 = document.getElementById('frame1');
    body.removeChild(frame1);

    // frame3 is added to the frame tree when the parent has the same number of
    // children as when frame2 was being added.  In the past this has led to
    // frame2 and frame3 having the same unique name - https://crbug.com/576969#c3
    frame3 = document.createElement('iframe');
    frame3.id = "frame3";
    body.appendChild(frame3);
}
</script>
</head>
<body onload="runTest()" id="body">
<iframe id="frame1"></iframe>
<iframe id="frame2"></iframe>
</body>
</html>
